<%@page import="itsm.isperp.framework.core.context.ContextHolder"%>
<%@page import="itsm.isperp.module.entity.app.AppDict"%>
<%@page import="java.util.List"%>
<%@page import="itsm.isperp.module.service.app.AppDictService"%>
<%@ page pageEncoding="UTF-8"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<jsp:include page="../common/top.jsp"></jsp:include>
<jsp:include page="../common/leftmenu.jsp"></jsp:include>

<%
	AppDictService appDictService = ContextHolder
			.getSpringBean("appDictService");

	List<AppDict> dicts = appDictService
			.findByType("INCIDENT_SATISFICATION");
%>
<form id="id" action="customer/help/incident/myIncidentClosed">

	<div class="fr" style="width: 780px">
		<div class="box_title">
			<i class="fa fa-table"></i>我的历史事件
		</div>
		<div>

			<table class="form-table" form="">
				<tr class="keywordSearch">
					<td colspan="3" align="left">报障时间： <input type="text"
						onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
						name="createDateStart" value="${createDateStart }" type="text"
						readonly="readonly" class="datetime required Wdate" />~ <input
						type="text" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
						name="createDateEnd" value="${createDateEnd }" type="text"
						readonly="readonly" class="datetime required Wdate" />
						<p style="padding:5px 0">
							&nbsp;关&nbsp;键&nbsp;字： <input type="text" name="txtKeyword"
								value="${keyword }" placeholder="关键字查询" id="txtKeyword"
								style="width:311px" /> <input style="cursor:pointer"
								id="btnKeySearch" type="submit" onclick="searchIncident();"
								name="btnKeySearch" value="&nbsp;&nbsp;查   询&nbsp;&nbsp;"
								title="查询">(可按编号、标题、问题描述、状态搜索)
						</p></td>
				</tr>
			</table>
		</div>
		<div class="box-content nopadding">
			<table class="table table-hover table-nomargin">
				<thead>
					<tr>
						<th style="width:40px">优先级</th>
						<th style="width:90px">编号</th>
						<th style="width:150px">标题</th>
						<th style="width:100px">报障时间</th>
						<th style="width:60px">处理状态</th>
						<th style="width:60px">评价结果</th>
						<th style="width:90px">操作</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach var="incident" items="${incidents }">
						<tr>
							<td><c:choose>
									<c:when test="${'一级' eq incident.priorityName }">
										<img src="img/incident/p1.png"
											title="${incident.priorityName }">
									</c:when>

									<c:when test="${'二级' eq incident.priorityName }">
										<img src="img/incident/p1.png"
											title="${incident.priorityName }">
									</c:when>
									<c:when test="${'三级' eq incident.priorityName }">
										<img src="img/incident/p1.png"
											title="${incident.priorityName }">
									</c:when>
									<c:when test="${'四级' eq incident.priorityName }">
										<img src="img/incident/p1.png"
											title="${incident.priorityName }">
									</c:when>
									<c:when test="${'五级' eq incident.priorityName }">
										<img src="img/incident/p1.png"
											title="${incident.priorityName }">
									</c:when>
									<c:otherwise>
										<img src="img/incident/p0.png" title="未确定级别">
									</c:otherwise>
								</c:choose>
							</td>
							<td>${incident.code }</td>
							<td><a class="ui-link-inherit" target="_blank"
								href="customer/help/incident/incidentDispaly?id=${incident.id }"><c:choose>
										<c:when test="${fn:length(incident.title) > 22}">
											<c:out value="${fn:substring(incident.title, 0, 22)}..." />
										</c:when>
										<c:otherwise>
											<c:out value="${incident.title}" />
										</c:otherwise>
									</c:choose> </a></td>
							<td><fmt:formatDate value="${incident.createDate }"
									pattern="yyyy-MM-dd HH:mm" /></td>
							<td>${incident.status }</td>
							<td>
 <c:set var="satisfaction"
									value="${incident.satisfaction }" scope="page" /> <%
 	Integer satisfactionStr = (Integer) pageContext
 				.getAttribute("satisfaction");
 		for (AppDict dict : dicts) {
 		    if(satisfactionStr==0)
 		    {
 		     %><%="未评价" %><%break;
 		    }
 			else if (dict.getCode().equals(String.valueOf(satisfactionStr))) {
 %> <%=dict.getName()%> <%break;
 	
 			}
 		}
 %> 

</td>
							<td>
							 <c:if test="${('成功解决' eq incident.closeCode) and (incident.areFeedback eq '0')}">
								  <a
								class="ui-link-inherit" target="_blank"
								href="customer/help/incident/userSatisfaction?id=${incident.id }">评价</a>
								</c:if>
							<a class="ui-link-inherit" target="_blank"
								href="customer/help/incident/incidentDispaly?id=${incident.id }">查看</a>&nbsp;&nbsp;<a
								class="ui-link-inherit" target="_blank"
								href="customer/help/incident/incidentInfo?id=${incident.id }">跟踪</a>
								
							</td>
						</tr>

					</c:forEach>


				</tbody>
			</table>
			<br> ${pager }
		</div>
	</div>
</form>


<jsp:include page="../common/bottom.jsp"></jsp:include>